package com.itheima;

import java.util.function.Consumer;
//【消费型接口 - Consumer】
public class Demo2 {
    public static void main(String[] args) {

        sayHello("admin", s -> System.out.println("hello:" + s));


        sayHello("admin", s -> System.out.println("hello:" + s), s -> System.out.println(s.length()));
    }

    public static void sayHello(String str, Consumer<String> con) {
        con.accept(str);
    }

    public static void sayHello(String str, Consumer<String> con1, Consumer<String> con2) {
        con1.andThen(con2).accept(str);
    }
}
